//
//  Body.h
//  NinjaTurtle
//
//  Created by Nguyen Tri Chung on 1/27/15.
//
//

#ifndef __NinjaTurtle__Body__
#define __NinjaTurtle__Body__

#include <stdio.h>
#include "cocos2d.h"

USING_NS_CC;

class Body : public Ref {
    CC_SYNTHESIZE(bool, rect, Rect);
    CC_SYNTHESIZE(Point, position, Position);
    CC_SYNTHESIZE(Point, velocity, Velocity);
    CC_SYNTHESIZE(float, rotationVelocity, RotationVelocity);
    CC_SYNTHESIZE(bool, physical, Physical);
    CC_SYNTHESIZE(bool, visible, Visible);
    CC_SYNTHESIZE(float, rotation, Rotation);
    CC_SYNTHESIZE(float, scaleX, ScaleX);
    CC_SYNTHESIZE(float, scaleY, ScaleY);
    CC_SYNTHESIZE(Point, anchorPoint, AnchorPoint);
    CC_SYNTHESIZE(float, rotationSkewY, RotationSkewY);
    CC_SYNTHESIZE(float, rotationSkewX, RotationSkewX);
    CC_SYNTHESIZE(bool, flipX, FlipX);
    CC_SYNTHESIZE(bool, flipY, FlipY);
private:
    void initialize();
public:
    Body();
    virtual ~Body();
    void setScale(float scale);
    float getScale();
    Point getNextPosition(float dt);
    float getNextRotation(float dt);
    void update(float dt);
    bool contains(Point point);
    bool nearby(Point point);
};
#endif /* defined(__NinjaTurtle__Body__) */
